home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / windows5 / xwinc100.zip / CONTRIB-.00 / CONTRIB- / contrib / examples / PEX / test_sss.c < prev    next >
C/C++ Source or Header  |  1991-02-16  |  4KB  |  150 lines

  1. /* $XConsortium: test_sss.c,v 5.2 91/02/16 09:32:36 rws Exp $ */
  2.  
  3. /***********************************************************
  4. Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. and the X Consortium.
  5.  
  6.             All Rights Reserved
  7.  
  8. Permission to use, copy, modify, and distribute this software and its 
  9. documentation for any purpose and without fee is hereby granted, 
  10. provided that the above copyright notice appear in all copies and that
  11. both that copyright notice and this permission notice appear in 
  12. supporting documentation, and that the names of Sun Microsystems,
  13. the X Consortium, and MIT not be used in advertising or publicity 
  14. pertaining to distribution of the software without specific, written 
  15. prior permission.  
  16.  
  17. SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 
  18. INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT 
  19. SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL 
  20. DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  21. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  22. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  23. SOFTWARE.
  24.  
  25. ******************************************************************/
  26.  
  27. #include <stdio.h>
  28. #include <phigs/phigs.h>
  29. #include <X11/Xlib.h>
  30. #include <X11/Xatom.h>
  31.  
  32. #include "structdefs.h"
  33.  
  34. extern void create_struct();
  35. extern void read_struct();
  36.  
  37. /*
  38.  *    Create and read back the structure
  39.  */
  40. static void
  41. create_and_read_structs()
  42. {
  43.     static Pint elem_id[] = {
  44.     PELEM_POLYLINE3,
  45.     PELEM_POLYLINE,
  46.     PELEM_POLYMARKER3,
  47.     PELEM_POLYMARKER,
  48.     PELEM_TEXT3,
  49.     PELEM_TEXT,
  50.     PELEM_ANNO_TEXT_REL3, 
  51.     PELEM_ANNO_TEXT_REL, 
  52.     PELEM_FILL_AREA3,
  53.     PELEM_FILL_AREA,
  54.     PELEM_FILL_AREA_SET3, 
  55.     PELEM_FILL_AREA_SET,
  56.     PELEM_CELL_ARRAY3,
  57.     PELEM_CELL_ARRAY,
  58.     PELEM_LINE_IND,
  59.     PELEM_MARKER_IND,
  60.     PELEM_TEXT_IND,
  61.     PELEM_INT_IND,
  62.     PELEM_EDGE_IND,
  63.     PELEM_LINETYPE,
  64.     PELEM_LINEWIDTH,
  65.     PELEM_LINE_COLR_IND,
  66.     PELEM_MARKER_TYPE,
  67.     PELEM_MARKER_SIZE,
  68.     PELEM_MARKER_COLR_IND,
  69.     PELEM_TEXT_FONT,
  70.     PELEM_TEXT_PREC,
  71.     PELEM_CHAR_EXPAN,
  72.     PELEM_CHAR_SPACE,
  73.     PELEM_TEXT_COLR_IND,
  74.     PELEM_CHAR_HT,
  75.     PELEM_CHAR_UP_VEC,
  76.     PELEM_TEXT_PATH,
  77.     PELEM_TEXT_ALIGN,  
  78.     PELEM_ANNO_CHAR_HT,
  79.     PELEM_ANNO_CHAR_UP_VEC,
  80.     PELEM_ANNO_PATH,
  81.     PELEM_ANNO_ALIGN, 
  82.     PELEM_ANNO_STYLE,
  83.     PELEM_INT_STYLE,
  84.     PELEM_INT_STYLE_IND,
  85.     PELEM_INT_COLR_IND,
  86.     PELEM_EDGE_FLAG,
  87.     PELEM_EDGETYPE,
  88.     PELEM_EDGEWIDTH,
  89.     PELEM_EDGE_COLR_IND,
  90.     PELEM_PAT_SIZE,
  91.     PELEM_PAT_REF_POINT_VECS, 
  92.     PELEM_PAT_REF_POINT,
  93.     PELEM_ADD_NAMES_SET, 
  94.     PELEM_REMOVE_NAMES_SET, 
  95.     PELEM_INDIV_ASF,
  96.     PELEM_HLHSR_ID,
  97.     PELEM_LOCAL_MODEL_TRAN3, 
  98.     PELEM_LOCAL_MODEL_TRAN, 
  99.     PELEM_GLOBAL_MODEL_TRAN3, 
  100.     PELEM_GLOBAL_MODEL_TRAN, 
  101.     PELEM_MODEL_CLIP_VOL3,  
  102.     PELEM_MODEL_CLIP_VOL, 
  103.     PELEM_MODEL_CLIP_IND, 
  104.     PELEM_RESTORE_MODEL_CLIP_VOL, 
  105.     PELEM_VIEW_IND,
  106.     PELEM_EXEC_STRUCT,
  107.     PELEM_LABEL,
  108.     PELEM_APPL_DATA,
  109.     PELEM_PICK_ID 
  110.     };
  111.  
  112.     Pint struct_id;
  113.     Pint_list structlist;
  114.     Pint_list elemlist;
  115.     Pint type;
  116.  
  117.     struct_id = 1;
  118.     structlist.num_ints = 1;
  119.     structlist.ints = &struct_id;
  120.  
  121.     type = SPECIFIED_ELEMENTS;
  122.     elemlist.num_ints = 66;
  123.     elemlist.ints = &elem_id[0];
  124.     create_struct(&structlist, &elemlist, type);
  125.     free(elemlist.ints);
  126. /*
  127.  *  read the contents of the structure and show the contents 
  128.  *  by printing them out on the display.
  129.  */
  130.     read_struct(&structlist);
  131. }
  132.  
  133. static void
  134. init_phigs()
  135. {
  136.     popen_phigs((char *)NULL, PDEF_MEM_SIZE);
  137. }
  138.  
  139. static void
  140. init()
  141. {
  142.     init_phigs();
  143. }
  144.  
  145. main()
  146. {
  147.     init();
  148.     create_and_read_structs();
  149. }
  150.